import axios from '../../axios'
const ADMIN_URL = '/admin';

const adminApi = {
    //登录
    loginApi(data) {
        return axios({
            url: ADMIN_URL + "/login",
            method: 'post',
            data,
        });
    },
    //添加管理员
    addAccountApi(data){
        return axios({
            url:ADMIN_URL + "/addAdmin",
            method:'post',
            data,
        });
    },
    //获取管理员数据
    getAdminListApi(data){
        return axios({
            url:ADMIN_URL + "/findAllAdmins",
            method:"post",
            data,
        });
    },
    //删除管理员
    delAdminApi(_id){
        return axios({
            url:ADMIN_URL + "/delAdmin",
            method:"post",
            data:{_id},
        });
    },
    //通过Id获取管理员
    getAdminByIdApi(_id){
        return axios({
            url:ADMIN_URL + "/findAdminByID",
            method:"post",
            data:{_id},
        });
    },
    //修改管理员信息
    upDataAdminApi(data){
        return axios({
            url:ADMIN_URL + "/changeAdminInfo",
            method:'post',
            data,
        });
    },
    //验证管理员是否登录
    isLogin(){
        return axios({
            url:ADMIN_URL + '/isLogin',
            method:'post',
        });
    },

}

export default adminApi